package com.yhb.utils;

import me.edzh.spring.bootstrap.interceptor.CORSInterceptor;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

@Service
public class AllowedOrigins implements CORSInterceptor.CORSProvider {
    @Override
    public List<String> allowedOrigins() {
        return Arrays.asList("https://admin.ylmvip.cn", "https://test.admin.ylmvip.cn", "http://localhost:5577");
    }

    @Override
    public String[] allowedMethods() {
        return new String[]{"GET", "POST", "OPTIONS", "PUT"};
    }

    @Override
    public String[] allowedHeaders() {
        return new String[]{"Authorization", "Content-Type", "Access-Control-Allow-Origin"};
    }
}
